import os

from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.common.by import By

from config import IMAGE_BASE_PATH

# xcx_name = '哈夫元宇宙x酒馆'
xcx_name = '伴伴拼场'

'''
---------------------------------------------------------------
初始化元素（进入小程序前）
---------------------------------------------------------------
'''
init_xcx_name = By.XPATH, f'//*[contains(@text,"{xcx_name}")]'

'''
---------------------------------------------------------------
首页元素
---------------------------------------------------------------
'''
fp_url = ":pages/home/home.html:"
fp_mine_tab = By.XPATH, '//*[contains(text(),"我的")]', fp_url
fp_brand_name = AppiumBy.IMAGE, IMAGE_BASE_PATH + os.sep + 'img_4.png'
fp_signin_close = By.CSS_SELECTOR, '.contact-pop-delete-view', fp_url
# fp_chat_group_tab = By.XPATH, "//*[@class='scrollViewItem']//*[text()='长春']", fp_url
fp_chat_group_tab = By.XPATH, "//*[@class='scrollViewItem']//*[text()='大连']", fp_url
# fp_chat_group = By.XPATH, '//*[text()="青年汇群"][2]', fp_url
fp_chat_group = By.XPATH, '//*[text()="小鹅商家（总店）群"][2]', fp_url
fp_current_location = By.CSS_SELECTOR, ".searchLocName",fp_url
'''
---------------------------------------------------------------
我的页面元素
---------------------------------------------------------------
'''
mine_url = ":pages/user/user.html:"
mine_message_tab = By.XPATH, '//*[contains(text(),"消息")]', mine_url
mine_card_package = By.XPATH, '//*[contains(text(),"卡包")]', mine_url

'''
---------------------------------------------------------------
消息页面元素
---------------------------------------------------------------
'''
message_url = ":pages/TUI-Conversation/conversation/conversation.html:"
message_mine_tab = By.XPATH, '//*[contains(text(),"动态")]', message_url

'''
---------------------------------------------------------------
动态页面元素
---------------------------------------------------------------
'''
dynamic_url = ":pages/dynamicPage/dynamicPage.html:"
dynamic_fishpond_tab = By.XPATH, '//*[contains(text(),"鱼塘")]', dynamic_url

'''
---------------------------------------------------------------
鱼塘页面元素
---------------------------------------------------------------
'''
fishpond_url = ":pages/fishPond/fishPond.html:"
fishpond_fp_tab = By.XPATH, '//*[contains(text(),"首页")]', dynamic_url

'''
---------------------------------------------------------------
聊天群内页面元素
---------------------------------------------------------------
'''
chat_url = ':packageMangHeIm/pages/TUI-Chat/chat.html:'
chat_desk_num_close = By.CSS_SELECTOR, '.tablePopBoxClose', chat_url
chat_banner_ad = By.CSS_SELECTOR, '.wx-swiper-slides', chat_url
chat_rank = By.CSS_SELECTOR, '.animation-ranking', chat_url
chat_vip_mall = By.CSS_SELECTOR, '.vipStoreSign', chat_url
chat_group_people = By.CSS_SELECTOR, '.groupPeople', chat_url
chat_game = By.XPATH, "//*[@class='worldCup'][1]", chat_url
chat_hongbao = By.XPATH, "//*[@class='worldCup'][2]", chat_url
chat_vip_coming = By.XPATH, "//*[@class='worldCup1']", chat_url
chat_vip_tanchuang_close = By.XPATH, "//*[text()='考虑一下']", chat_url
chat_message_input_area = By.XPATH, "//*[@class='input-index--TUI-message-input-main']", chat_url
chat_message_send_btn = By.CSS_SELECTOR, ".input-index--TUI-sendMessage-btn", chat_url
chat_message_assert = By.XPATH, "//*[@class='message-list-index--next-container']/wx-view[1]//*[@class='text-message-index--message-body-span-text']", chat_url
chat_baping_btn = By.XPATH, "//*[@class='input-index--TUI-commom-function-itemIm']/wx-view[1]", chat_url
chat_baping_song_btn = By.XPATH, "//*[@class='input-index--TUI-commom-function-itemIm']/wx-view[2]", chat_url
chat_yiren_song_btn = By.XPATH, "//*[@class='input-index--TUI-commom-function-itemIm']/wx-view[3]", chat_url
chat_dashang_btn = By.XPATH, "//*[@class='input-index--TUI-commom-function-itemIm']/wx-view[4]", chat_url
chat_dainifei_btn = By.XPATH, "//*[@class='input-index--TUI-commom-function-itemIm']/wx-view[5]", chat_url
chat_gengduo_btn = By.XPATH, "//*[@class='input-index--TUI-commom-function-itemIm']/wx-view[6]", chat_url
chat_baping_send_btn = By.CSS_SELECTOR, '.popBottomBoxRi', chat_url
chat_baping_theme_list = By.CSS_SELECTOR, '.scrollViewOneItem', chat_url
chat_baping_input_msg = By.XPATH, "//*[@class='textareaBoxTop']/wx-textarea", chat_url
chat_baping_yulu_btn = By.CSS_SELECTOR, '.textareaBoxTopBtn', chat_url
chat_baping_pic_btn = By.CSS_SELECTOR, '.textareaBoxBotImgBox', chat_url
chat_baping_coin_pay = By.CSS_SELECTOR, "#point", chat_url
chat_baping_money_pay = By.CSS_SELECTOR, "#money", chat_url
chat_baping_menu_close = By.CSS_SELECTOR, '.colseBtn', chat_url
chat_baping_assert_time = By.XPATH, "//*[@class='message-list-index--next-container']/wx-view[1]//*[@class='custom-message-index--baValTopRi']/wx-view[1]", chat_url
chat_baping_assert_msg = By.XPATH, "//*[@class='message-list-index--next-container']/wx-view[1]//*[@class='custom-message-index--baText']", chat_url
chat_dainifei_kind1 = By.XPATH, "//*[@class='themeScrollItem'][1]", chat_url
chat_dainifei_kind2 = By.XPATH, "//*[@class='themeScrollItem'][2]", chat_url
chat_dainifei_time30 = By.XPATH, "//*[@class='flyValBox']//*[text()='30秒']", chat_url
chat_dainifei_time60 = By.XPATH, "//*[@class='flyValBox']//*[text()='60秒']", chat_url
chat_dainifei_input_msg = By.XPATH, "//*[@class='textBoxLfVal']/wx-textarea", chat_url
chat_dainifei_coin_pay = By.XPATH, "//*[@class='flyValBox']//*[@id='point']", chat_url
chat_dainifei_money_pay = By.XPATH, "//*[@class='flyValBox']//*[@id='money']", chat_url
chat_dainifei_send_btn = By.CSS_SELECTOR, ".flyPayBtn", chat_url
chat_dainifei_assert_time = By.XPATH, "//*[@class='message-list-index--next-container']/wx-view[1]//*[@class='custom-message-index--flyTopLf']/wx-view[1]", chat_url
chat_dainifei_assert_msg = By.XPATH, "//*[@class='message-list-index--next-container']/wx-view[1]//*[@class='custom-message-index--flyText']", chat_url
chat_song_open_more = By.XPATH, "//*[@class='message-list-index--next-container']/wx-view[1]//wx-view[text()='展开']", chat_url
chat_song_name1_assert = By.XPATH, "//*[@class='message-list-index--next-container']/wx-view[1]//wx-view[@class='custom-message-index--songItem'][1]/wx-view[1]", chat_url
chat_song_name2_assert = By.XPATH, "//*[@class='message-list-index--next-container']/wx-view[1]//wx-view[@class='custom-message-index--songItem'][2]/wx-view[1]", chat_url
chat_song_name3_assert = By.XPATH, "//*[@class='message-list-index--next-container']/wx-view[1]//wx-view[@class='custom-message-index--songItem'][3]/wx-view[1]", chat_url
chat_song_msg_assert = By.XPATH, "//*[@class='message-list-index--next-container']/wx-view[1]//*[@class='custom-message-index--songTitleLf']", chat_url
chat_song_num_assert = By.XPATH, "//*[@class='message-list-index--next-container']/wx-view[1]//*[@class='custom-message-index--songTitleRi']", chat_url
chat_dashang_theme_list = By.CSS_SELECTOR,".giveGiftPopBoxVal-giftItem",chat_url
chat_dashang_menu_close = By.CSS_SELECTOR, ".giveGiftPopBoxVal-giftBoxLogoRi",chat_url
chat_dashang_input_msg = By.CSS_SELECTOR, ".giveGiftPopBoxVal-saySomeText", chat_url
chat_dashang_coin_pay = By.XPATH,"//*[@class='giveGift-giftPayTopMain']/wx-view[2]",chat_url
chat_dashang_money_pay = By.XPATH, "//*[@class='giveGift-giftPayTopMain']/wx-view[1]",chat_url
chat_dashang_send_btn = By.CSS_SELECTOR, '.giveGift-giftPayNumBoxBtn', chat_url
chat_dashang_assert_gift =By.XPATH,"//*[@class='message-list-index--next-container']/wx-view[1]//*[@class='custom-message-index--chatSinger-dianGeGift-name']",chat_url
chat_dashang_assert_obj =By.XPATH, "//*[@class='message-list-index--next-container']/wx-view[1]//*[@class='custom-message-index--chatSinger-dianGeGift-singerName']",chat_url
chat_dashang_assert_msg =By.XPATH, "//*[@class='message-list-index--next-container']/wx-view[1]//*[@class='custom-message-index--songTitleLf-singer']",chat_url

'''
---------------------------------------------------------------
霸屏点歌页面元素
---------------------------------------------------------------
'''
song_url = ':packageHome/pages/chooseSongs/chooseSongs.html:'
song_hot_rank = By.XPATH, "//*[text()='热歌榜']", song_url
song_bottom_btn = By.CSS_SELECTOR, ".bottomBtnItem", song_url
song_input_msg = By.XPATH, "//*[@class='textareaBoxTop']/wx-textarea", song_url
song_coin_pay = By.CSS_SELECTOR, "#point", song_url
song_money_pay = By.CSS_SELECTOR, "#money", song_url
song_send_btn = By.CSS_SELECTOR, ".popBottomBoxRi", song_url
song_close_send_result = By.CSS_SELECTOR, ".payResultPopBoxBtnBoxRi", song_url
song_back_to_chat = By.CSS_SELECTOR, '.searchLocRi', song_url
song_selected_tab = By.XPATH, "//*[text()='已点歌单']", song_url
song_selected_titles = By.XPATH, "//*[@class='songBoxTitle']",song_url
'''
---------------------------------------------------------------
支付小程序抽盲盒页面元素
---------------------------------------------------------------
'''
pay_manghe_url = ':packageActivity/pages/mangHeSell/mangHeSell.html:'
pay_manghe_assert = By.CSS_SELECTOR, '.ogbTitleLf', pay_manghe_url
'''
---------------------------------------------------------------
排行榜页面元素
---------------------------------------------------------------
'''
rank_url = ':packageHome/pages/rankingList/rankingList.html:'
rank_title = By.CSS_SELECTOR, '.tabBox', rank_url
'''
---------------------------------------------------------------
vip页面元素
---------------------------------------------------------------
'''
vip_url = ':packageShop/pages/vipStore/vipStore.html:'
vip_open_button = By.CSS_SELECTOR, '.imgBoxItemBtn', vip_url
'''
---------------------------------------------------------------
群内成员页面元素
---------------------------------------------------------------
'''
group_people_url = ':packageMangHeIm/pages/imGroupList/imGroupList.html:'
group_people_list = By.CSS_SELECTOR, '.memberListBox', group_people_url
'''
---------------------------------------------------------------
游戏页面元素
---------------------------------------------------------------
'''
game_url = ':packageMangHeIm/pages/gameList/gameList.html:'
game_list = By.CSS_SELECTOR, '.listBox', game_url
game_dahuatou = By.XPATH, "//*[text()='大话骰']", game_list
game_tuiyitui = By.XPATH, "//*[text()='推一推']", game_list
game_xiaoxingxing = By.XPATH, "//*[text()='消星星']", game_list
game_nihuawocai = By.XPATH, "//*[text()='你画我猜']", game_list
game_woconglaimeiyou = By.XPATH, "//*[text()='我从来没有']", game_list
game_zhenxinhua = By.XPATH, "//*[text()='真心话大冒险']", game_list

'''
---------------------------------------------------------------
红包页面元素
---------------------------------------------------------------
'''
hongbao_url = ':packageMangHeIm/pages/imRedPackage/imRedPackage.html:'
hongbao_amount = By.CSS_SELECTOR, ".amount", hongbao_url
